/**
 * Created by Administrator on 2017/9/20.
 */
angular.module('service.recommended', [
        "ngResource",
    ])
    .service('RecommendedService', RecommendedService);
RecommendedService.$inject = ['$resource'];
function RecommendedService($resource) {

    // 添加菜品信息
    this.addFoodInfo = function (foodinfo, success, error) {
        var resource = $resource(foodinfoUrl + "foodinfo", {}, {
            save: {
                method: "POST",
                isArray: true,
            }
        });
        return resource.save({}, foodinfo, success, error);
    };

    // 删除菜品信息
    this.deleteFoodInfo = function (shopid, success, error) {
        var resource = $resource(foodinfoUrl + "foodinfo/shopid/:shopid");
        return resource.remove({shopid: shopid}, success, error);
    };

    // 通过店铺id获取菜品信息
    this.getFoodInfo = function (shopid) {
        var resource = $resource(foodinfoUrl + "foodinfo/:shopid");
        return resource.query({shopid: shopid});
    }
}